package top.hmtools.makedata.random;

/**
 * 随机长整型工具
 * @author HyboWork
 *
 */
public class RandomLong implements IRandom<Long> {

	@Override
	public Long getRandom(){
//		Random random = new Random();
		return random.nextLong();
	}
	
	/**
	 * 获取指定范围的随机长整型数
	 * @param min
	 * @param max
	 * @return
	 */
	public Long getRandom(long min,long max){
		long offset = max - min;
		if(offset<=0){
			return 0L;
		}
//		Random random = new Random();
		long temp = Math.abs(random.nextLong());
		return temp%offset+min;
	}
}
